<div class="bg-light lter b-b wrapper-md">
  <h1 class="m-n font-thin h3">产品管理</h1>
</div>
<toaster-container toaster-options="{'position-class': 'toast-center', 'close-button':true,'time-out':'500'}"></toaster-container>
<div class="wrapper-md">
  <div class="panel panel-default">
    <div class="panel-heading">
      活期产品管理列表
    </div>
    <div class="panel-body b-b b-light">
      <div class="form-group pull-in clearfix">
        <div class="col-sm-2">
          <label><font><font>产品状态:</font></font></label>
          <select class="form-control ng-pristine ng-untouched ng-invalid ng-invalid-required" ng-model="requestArr.ProductStatus"
            >
              <option value="">全部</option>
	    				<option value="1">未发布</option>
	    				<option value="2">已发布</option>
              <option value="3">募资中</option>
              <option value="4">已满标</option>
              <option value="5">还款中</option>
              <option value="6">提前还清</option>
              <option value="7">已还清</option>
              <option value="8">等待推送至银行</option>
              <option value="13">流标</option>
              <option value="15">草稿</option>
              <option value="16">已删除</option>
	    			</select>
        </div>
        <div class="col-sm-2">
          <label><font><font>产品编号:</font></font></label>
          <input type="text" class="form-control ng-pristine ng-untouched ng-invalid ng-invalid-required"  ng-model="requestArr.ProductCode">
        </div>
        <div class="col-sm-2">
          <label><font><font>产品名称:</font></font></label>
          <input type="text" class="form-control ng-pristine ng-untouched ng-invalid ng-invalid-required"  ng-model="requestArr.ProductName">
        </div>
        <div class="col-sm-2">
          <label><font><font>借款人ID:</font></font></label>
          <input type="text" class="form-control ng-pristine ng-untouched ng-invalid ng-invalid-required"  ng-model="requestArr.UserId">
        </div>
      </div>
      <div class="form-group pull-in clearfix" ng-controller="DatepickerDemoCtrl">
        <div class="col-sm-2">
          <label><font><font>满标开始时间:</font></font></label>
          <p class="input-group">
            <span class="input-group-btn">
                    <button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
                  </span>
            <input type="text" class="form-control" datepicker-popup="{{format}}" ng-click="open($event)" ng-model="requestArr.FullstartTime"
              is-open="opened" max-date="maxDate" datepicker-options="dateOptions" ng-required="true" close-text="Close" />
          </p>
        </div>
        <div class="col-sm-2">
          <label><font><font>满标结束时间:</font></font></label>
          <p class="input-group">
            <span class="input-group-btn">
                    <button type="button" class="btn btn-default" ng-click="open1($event)"><i class="glyphicon glyphicon-calendar"></i></button>
                  </span>
            <input type="text" class="form-control" datepicker-popup="{{format}}" ng-click="open1($event)" ng-model="requestArr.FullendTime"
              is-open="opened1" max-date="maxDate" datepicker-options="dateOptions" ng-required="true" close-text="Close" />
          </p>
        </div>
        <div class="col-sm-2">
          <button class="btn btn-info btn-addon" style="margin-top:25px" ng-if='!graybtn' ng-click="search()">查询</button>
          <button class="btn btn-light btn-addon"  style="margin-top:25px" ng-if='graybtn'>查询</button>
        </div>
      </div>

      <div class="form-group pull-in clearfix">
        <div class="col-sm-6">
          <button class="btn btn-info btn-addon" ng-click="addproductdhuo()">添加</button>
          <button class="btn btn-info btn-addon" ng-click="delCache()">删除缓存</button>
        </div>
      </div>
    </div>

    <div class="table-responsive">
      <table id="tab" class="table table-striped m-b-none">
        <thead>
          <caption ng-bind="'发标总金额:'+TotalLoanPrice+'元，满标总金额:'+TotalFullPrice+'元'"></caption>
          <tr>
            <th style="min-width: 60px">产品编号</th>
            <th style="min-width: 100px">产品名称</th>
            <th style="min-width: 100px">借款人</th>
            <th style="min-width: 100px">发标金额</th>
            <th style="min-width: 100px">满标金额</th>
            <th style="min-width: 100px">年化总利率</th>
            <th style="min-width: 100px">加息利率</th>
            <th style="min-width: 100px">产品状态</th>
            <th style="min-width: 100px">创建时间</th>
            <th style="min-width: 120px">募集时间</th>
            <th style="min-width: 100px">满标时间</th>
            <!-- <th style="min-width: 120px">授权标示</th> -->
            <th style="min-width: 200px">操作</th>
          </tr>
        </thead>
        <tbody>
          <tr ng-if="QueryLoanProductList=='' || QueryLoanProductList==null">
            <td colspan="9">当前无任何数据</td>
          </tr>
          <tr ng-if="QueryLoanProductList!=''" ng-repeat="obj in QueryLoanProductList">
            <td ng-bind="obj.ProductCode"></td>
            <td ng-bind="obj.ProductName"></td>
            <td ng-bind="obj.LoanUserName"></td>
            <td ng-bind="obj.LoanPrice"></td>
            <td ng-bind="obj.ReallyPrice"></td>
            <td ng-bind="obj.AnnualRateOfYear"></td>
            <td ng-bind="obj.ShowRate"></td>
            <td ng-bind="status(obj.ProductStatus)"></td>
            <td ng-bind="obj.CreateTime | date : 'yyyy-MM-dd HH:mm:ss'"></td>
            <td ng-bind="obj.FirstOnlineTime | date : 'yyyy-MM-dd HH:mm:ss'"></td>
            <td ng-bind="obj.FullTime | date : 'yyyy-MM-dd HH:mm:ss'"></td>
            <!-- <td ng-bind="obj.IsAuthRepay?'成功':'失败'"></td> -->
            <td>
              <button class="btn m-b-xs btn-sm btn-info" style="margin-right:10px;" ng-click="Release(obj.Id)" ng-if="obj.ProductStatus==1">发布</button>
              <button class="btn m-b-xs btn-sm btn-info" style="margin-right:10px;" ng-click="edit(obj.Id)">编辑</button>
              <button class="btn m-b-xs btn-sm btn-info" style="margin-right:10px;" ng-click="delete(obj)" ng-if="obj.ProductStatus==1||obj.ProductStatus==2">删除</button>
              <button class="btn m-b-xs btn-sm btn-info" ng-click="Raise(obj.Id)" ng-if="obj.ProductStatus==2">募资中</button>
              <button class="btn m-b-xs btn-sm btn-info" ng-click="hqmanb(obj)" ng-if="obj.ProductStatus==3">虚拟人满标</button>
              <button class="btn m-b-xs btn-sm btn-info" ng-click="fullScale(obj.Id)" ng-if="obj.ProductStatus==3">紧急满标</button>
              <!-- <button class="btn m-b-xs btn-sm btn-info" ng-click="hcash(obj.Id)">一键还款</button> -->
              <!-- <button class="btn m-b-xs btn-sm btn-info" ng-click="editstatus(obj.Id,obj.IsAuthRepay)">修改授权状态</button> -->
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
  <div class="btn-group pull-left" style="margin-bottom:30px;">
    <select class="form-control pull-left ng-pristine ng-invalid ng-invalid-required ng-touched" style="width:70px;" ng-model="requestArr.pageSize">
            <option value="5">5</option>
            <option value="10">10</option>
            <option value="15">15</option>
	  </select>
    <button type="button" class="btn btn-default" ng-click="godata()"><font><font>确定</font></font></button>
  </div>
  <div class="btn-group pull-right">
    <button type="button" class="btn btn-default" ng-click="prev()"><font><font>上一页</font></font></button>
    <button type="button" class="btn btn-default btnNum">{{requestArr.pageIndex}}</button>
    <button type="button" class="btn btn-default" ng-click="next()"><font><font>下一页</font></font></button>
    <button type="button" class="btn btn-default" ng-click="end()"><font><font>尾页</font></font></button>
    <span class="btn btn-default">共<span ng-bind="QueryLoanProductListTotal+'条数据'"></span></span>
    <span class="btn btn-default">共<span ng-bind="page+'页'"></span></span>
  </div>
</div>

<div class="bg_f none" style="min-height:{{deviceInfo.height}}px; position:relative;">
  <section>
    <h1>开户申请</h1>
    <form action="" method="POST" id="idmyForm" target="_blank">
      merchant_id:<input type="text" name="merchant_id" value="{{formdata.MerchantId}}" /><br /> data:
      <input type="text" name="data" value="{{formdata.Data}}" /><br /> encryptkey:
      <input type="text" name="encryptkey" value="{{formdata.EncrypKey}}" /><br />
      <!-- 注意reqData域 value用单引号 -->
      <button type="submit">申请</button>
    </form>
  </section>
</div>